#ifndef Vector2_h
#define Vector2_h

#include <math.h>

class Vector2
{
public:
	Vector2();
	Vector2(double p_x, double p_y);

	double getLength() const;
	double getX() const;
	double getY() const;

	void setX(double p_x);
	void setY(double p_y);

	void invert();
	void normalize();
	double dotProduct(const Vector2 &p_vector) const;

	Vector2& operator=(const Vector2 &p_vector);
	const Vector2 operator+(const Vector2 &p_vector) const;
	Vector2& operator+=(const Vector2 &p_vector);
	const Vector2 operator-(const Vector2 &p_vector) const;
	Vector2& operator-=(const Vector2 &p_vector);
	const Vector2 operator*(double p_scalar) const;
	Vector2& operator*=(double p_scalar);
	const Vector2 operator/(double p_scalar) const;
	Vector2& operator/=(double p_scalar);
	bool operator==(const Vector2 &p_vector) const;

protected:
	double m_x;
	double m_y;
};

#endif //Vector2
